import {
  createRouter,
  createWebHistory
} from 'vue-router'
import EmployeeMain from '../views/main/EmployeeMain.vue'
import EmployerMain from '../views/main/EmployerMain.vue'
import ProfileFill from '../views/ProfileFill.vue'


const routes = [{
    path: '/',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/employee',
    name: 'EmployeeMain',
    component: EmployeeMain,
    children: [{
        path: '',
        name: 'EmployeeHome',
        component: () => import('../views/main/employee/Home.vue'),
        children: [{
            path: 'recomment',
            name: 'Recomment',
            component: () => import('../views/main/employee/HomeRecomment.vue')
          },
          {
            path: 'selection',
            name: 'Selection',
            component: () => import('../views/main/employee/HomeSelection.vue')
          }
        ]
      },
      {
        path: 'notes',
        name: 'Notes',
        component: () => import('../views/main/employee/notes/NotesHome.vue'),
        children: [{
          path: 'employeeEdit',
          name: 'EmployeeEdit',
          component: () => import('../views/main/employee/EmployeeEdit.vue')
        }]
      },
      {
        path: 'job/:id',
        name: 'JobDetail',
        component: () => import('../views/main/employee/JobDetail.vue')
      },
      {
        path: 'message',
        name: 'EmployeeMessage',
        component: () => import('../views/main/employee/EmployeeMessage')
      }
    ]
  },
  {
    path: '/employer',
    name: 'EmployerMain',
    component: EmployerMain,
    children: [
      {
        path: 'releasePosition',
        name: 'ReleasePosition',
        component: () => import('../views/main/employer/ReleasePosition.vue')
      },
      {
        path: 'message',
        name: 'EmployerMessage',
        component: () => import('../views/main/employer/EmployerMessage.vue')
      },
      {
        path: 'profile',
        name: 'EmployerProfile',
        component: () => import('../views/main/employer/EmployerProfile.vue')
      },
    ]
  },
  {
    path: '/profile',
    name: 'Fill',
    component: ProfileFill,
    children: [{
        path: 'employee',
        name: 'ProfileEmployee',
        component: () => import('../views/profile/EmployeeProfile.vue')
      },
      {
        path: 'employer',
        name: 'ProfileEmployer',
        component: () => import('../views/profile/EmployerProfile.vue')
      }
    ]
  }

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router